<%@ page pageEncoding="utf-8"%>
<%@ include file="/common/taglibs.jsp"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>深航服务信息系统</title> 
<script src="<c:url value='/scripts/common.js'/>"></script>
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
-->
</style>
<link rel="stylesheet" type="text/css" media="all"	href="<c:url value='/styles/layout.css'/>" />
<script src="<c:url value="/scripts/date.js"/>" language="javascript"></script>
</head>

<body leftmargin="0" topmargin="0">
<html:form action="vipServiceSheet" method="post" styleId="vipServiceSheetForm">
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
  <tr> 
    <td class="home-content-title">
    <img src="images/home_ico_listTitle.gif" width="22" height="20" align="absmiddle">
     &nbsp;高端旅客服务申请单管理</td>
  </tr>
  <tr> 
    <td height="25" class="home-table-tool-content02">
     <input type="button" 
                     	class="home-table-inputbox"
        		onclick="location.href='<c:url value="/vipServiceSheet.html?method=edit"/>'"
        		value="<fmt:message key="button.add"/>"/>
     <input type="button" class="home-table-inputbox"
        		onclick="doDelete('selected_id')"
        		value="<fmt:message key="button.delete"/>"/>	 
    </td>
  </tr>
  <tr>
	<td height="30" class="home-search-space">
		<table>
		<tr height="30" class="home-search-space">
			<td align=right>航班号：</td>
			<td>
			<html:text property="flightNum" styleId="flightNum222" onkeypress="return specialLetter();"
			maxlength="10"
			styleClass="home-table-inputbox" size="12"/></td>
			<td align=right>日期：</td>
			<td>
			<html:text property="flightDate" styleId="flightNum" styleClass="home-table-inputbox" maxlength="18"  size="12"/> 
			<img src="images/date.gif" width="16" height="15" onclick="fPopCalendar(flightDate,flightDate);return false"/></td>
			<td align=right>始发站：</td>
			<td>
			<html:text property="fromPort" styleId="fromPort" maxlength="5" onkeypress="return specialLetter();" styleClass="home-table-inputbox" size="12"/>
			<td align=right>终点站：</td>
			<td>
			<html:text property="toPort" styleId="toPort" maxlength="5" onkeypress="return specialLetter();" styleClass="home-table-inputbox" size="12"/></td>
		</tr>
		<tr height="30" class="home-search-space">
			<td align=right>旅客类型：</td>
			<td>
			<html:select name="vipServiceSheetForm" property="vipTypeId" size="1" styleId="vipTypeId">
			  <html:option  value="">&nbsp;</html:option> 
			  <html:options collection="vipTypeInfo" property="id" labelProperty="name"/> 
			</html:select>
			</td>
			<td align=right>订座编码：</td>
			<td>
			<html:text property="bookNumb" maxlength="10" styleId="bookNumb" onkeypress="return specialLetter();" styleClass="home-table-inputbox" size="12"/>
			<td align=right>旅客姓名：</td>
			<td>
			<html:text property="name" styleId="name" styleClass="home-table-inputbox" onkeypress="return specialLetter();" size="12" maxlength="32"/>
			</td>
			<td><input name="Submit2" type="button" class="home-inputBtn" value="查询" onClick="javascript:vipSearch();"/>
			&nbsp;&nbsp;<input name="Submit3" type="button" class="home-inputBtn" value="重置" onClick="doReset('flightNum','flightDate','fromPort','toPort','vipTypeId','bookNumb','name');"/>
			</td>
		 </tr>
	</table>
	</td>
   </tr>

   <tr> 
    <td valign="top"> <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
        <tr> 
          <td class="home-table-topline"> </td>
        </tr>
        <tr> 
          <td class="home-table-leftline"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td class="home-table-tool-content02"><sasis:page items="${vipServiceSheetList}"/></td>
              </tr>
              <tr> 
                <td align="center" valign="top" class="home-edittable-space">	
		<table width="100%" border="0" cellpadding="2" cellspacing="0" class="list_bordercolor">
                    <tr> 
                      <td width="2%" class="home-list-title"><div align="center"> 
                          <input type="checkbox" name="checkbox" value="checkbox" onclick='chooseAll(this);' />
                        </div></td>
                      <!-- 
                      <td  width="20%" class="home-list-title">&nbsp;<fmt:message key="vipServiceSheetForm.id"/></td>
                      <td  width="20%" class="home-list-title">&nbsp;<fmt:message key="vipServiceSheetForm.passengerId"/></td>
                      <td  width="20%" class="home-list-title">&nbsp;<fmt:message key="vipServiceSheetForm.vipInfoId"/></td> -->  
                      
                      <td  width="10%" class="home-list-title">&nbsp;航班号</td>
                      <td  width="10%" class="home-list-title">&nbsp;日期</td>
                      <td  width="10%" class="home-list-title">&nbsp;旅客姓名</td>
                      <td  width="10%" class="home-list-title">&nbsp;旅客类型</td>
                      <!-- 
                      <td  width="20%" class="home-list-title">&nbsp;<fmt:message key="vipServiceSheetForm.gender"/></td>
                      <td  width="20%" class="home-list-title">&nbsp;<fmt:message key="vipServiceSheetForm.idCard"/></td> -->
                      <td  width="10%" class="home-list-title">&nbsp;职务</td>
                      <td  width="10%" class="home-list-title">&nbsp;订座编码</td>
                       <td  width="10%" class="home-list-title">&nbsp;始发站</td>
                      <td  width="10%" class="home-list-title">&nbsp;终点站</td>
                      <!-- 
                      <td  width="20%" class="home-list-title">&nbsp;<fmt:message key="vipServiceSheetForm.order"/></td>
                      <td  width="20%" class="home-list-title">&nbsp;<fmt:message key="vipServiceSheetForm.retinueName"/></td>
                      <td  width="20%" class="home-list-title">&nbsp;<fmt:message key="vipServiceSheetForm.retinueNum"/></td>
                      <td  width="20%" class="home-list-title">&nbsp;<fmt:message key="vipServiceSheetForm.retinueOrder"/></td>
                      <td  width="20%" class="home-list-title">&nbsp;<fmt:message key="vipServiceSheetForm.bookTicket"/></td>
                      <td  width="20%" class="home-list-title">&nbsp;<fmt:message key="vipServiceSheetForm.provideFood"/></td>
                      <td  width="20%" class="home-list-title">&nbsp;<fmt:message key="vipServiceSheetForm.sentCar"/></td>
                      <td  width="20%" class="home-list-title">&nbsp;<fmt:message key="vipServiceSheetForm.boardCheck"/></td>
                      <td  width="20%" class="home-list-title">&nbsp;<fmt:message key="vipServiceSheetForm.receivedMan"/></td>
                      <td  width="20%" class="home-list-title">&nbsp;<fmt:message key="vipServiceSheetForm.visitantRoom"/></td>
                      <td  width="20%" class="home-list-title">&nbsp;<fmt:message key="vipServiceSheetForm.cabinService"/></td>
                      <td  width="20%" class="home-list-title">&nbsp;<fmt:message key="vipServiceSheetForm.receivedCar"/></td>
                      <td  width="20%" class="home-list-title">&nbsp;<fmt:message key="vipServiceSheetForm.receivedOffice"/></td>
                      <td  width="20%" class="home-list-title">&nbsp;<fmt:message key="vipServiceSheetForm.other"/></td>
                      <td  width="20%" class="home-list-title">&nbsp;<fmt:message key="vipServiceSheetForm.serviceHint"/></td>
                      <td  width="20%" class="home-list-title">&nbsp;<fmt:message key="vipServiceSheetForm.foodDesire"/></td>
                      <td  width="20%" class="home-list-title">&nbsp;<fmt:message key="vipServiceSheetForm.serviceDesire"/></td>
                      <td  width="20%" class="home-list-title">&nbsp;<fmt:message key="vipServiceSheetForm.operator"/></td>
                      <td  width="20%" class="home-list-title">&nbsp;<fmt:message key="vipServiceSheetForm.operateDate"/></td> -->
		      <td class="home-list-title" width="30">&nbsp;更新</td>
		      <td class="home-list-title"  width="30">&nbsp;审核</td>		   				 
		      <td class="home-list-title"  width="30">&nbsp;查看</td>
		      <td class="home-list-title"  width="70">&nbsp;保障情况</td>
                    </tr>
                    <c:forEach var="results" items="${vipServiceSheetList}" varStatus="status">
                    <tr>
                      <td class="home-list-content">
                        <input type="checkbox" name="selected_id" value="<c:out value='${results.id}'/>" approvedMan="<c:out value="${results.approvedMan}"/>" procInstId="<c:out value="${results.procInstId}"/>"/>
                      </td>
                      <!-- 
                      <td class="home-list-content">&nbsp;<c:out value="${results.id}"/></td>
                      <td class="home-list-content">&nbsp;<c:out value="${results.passengerId}"/></td>
                      <td class="home-list-content">&nbsp;<c:out value="${results.vipInfoId}"/></td> -->
                      
                      <td class="home-list-content">&nbsp;
                      <c:choose>
					   <c:when test="${results.procInstId!=null}">
					   <font style="color:#339900"><c:out value="${results.flightNum}"/></font></c:when>
					   <c:when test="${results.approvedMan!=null}">
					   <font style="color:#0099FF"><c:out value="${results.flightNum}"/></font></c:when>
					   <c:otherwise>
					   <font style="color:#000000"><c:out value="${results.flightNum}"/></font></c:otherwise>
					 </c:choose>
                      </td>
                      <td class="home-list-content">&nbsp;<c:out value="${results.flightDate}"/></td>
                      <td class="home-list-content">&nbsp;<c:out value="${results.name}"/></td>
                      <td class="home-list-content">&nbsp;<c:out value="${results.vipTypeName}"/></td>
                      <!-- 
                      <td class="home-list-content">&nbsp;<c:out value="${results.gender}"/></td>
                      <td class="home-list-content">&nbsp;<c:out value="${results.idCard}"/></td> -->
                      <td class="home-list-content">&nbsp;<c:out value="${results.duty}"/></td>
                      <td class="home-list-content">&nbsp;<c:out value="${results.bookNumb}"/></td>
                      <td class="home-list-content">&nbsp;<c:out value="${results.fromPortName}"/></td>
                      <td class="home-list-content">&nbsp;<c:out value="${results.toPortName}"/></td>
                      <!-- 
                      <td class="home-list-content">&nbsp;<c:out value="${results.order}"/></td>
                      <td class="home-list-content">&nbsp;<c:out value="${results.retinueName}"/></td>
                      <td class="home-list-content">&nbsp;<c:out value="${results.retinueNum}"/></td>
                      <td class="home-list-content">&nbsp;<c:out value="${results.retinueOrder}"/></td>
                      <td class="home-list-content">&nbsp;<c:out value="${results.bookTicket}"/></td>
                      <td class="home-list-content">&nbsp;<c:out value="${results.provideFood}"/></td>
                      <td class="home-list-content">&nbsp;<c:out value="${results.sentCar}"/></td>
                      <td class="home-list-content">&nbsp;<c:out value="${results.boardCheck}"/></td>
                      <td class="home-list-content">&nbsp;<c:out value="${results.receivedMan}"/></td>
                      <td class="home-list-content">&nbsp;<c:out value="${results.visitantRoom}"/></td>
                      <td class="home-list-content">&nbsp;<c:out value="${results.cabinService}"/></td>
                      <td class="home-list-content">&nbsp;<c:out value="${results.receivedCar}"/></td>
                      <td class="home-list-content">&nbsp;<c:out value="${results.receivedOffice}"/></td>
                      <td class="home-list-content">&nbsp;<c:out value="${results.other}"/></td>
                      <td class="home-list-content">&nbsp;<c:out value="${results.serviceHint}"/></td>
                      <td class="home-list-content">&nbsp;<c:out value="${results.foodDesire}"/></td>
                      <td class="home-list-content">&nbsp;<c:out value="${results.serviceDesire}"/></td>
                      <td class="home-list-content">&nbsp;<c:out value="${results.operator}"/></td>
                      <td class="home-list-content">&nbsp;<c:out value="${results.operateDate}"/></td> -->
		    <td class="home-list-content" width="30" align="center">&nbsp;
		    	<img src="./images/edit.gif" width="14" height="14" style="cursor:hand"  alt="<fmt:message key="button.edit"/>" onClick="window.location='./vipServiceSheet.html?method=edit&id=<c:out value="${results.id}"/>'">&nbsp;
		    </td>
		    <td class="home-list-content" width="30" align="center">&nbsp;
		    	<img src="./images/shenhe.gif" width="14" height="14" style="cursor:hand"  alt="审核"  onClick="window.location='./vipServiceSheet.html?method=view&approved=yes&id=<c:out value="${results.id}"/>'">&nbsp;
		    </td>
		    <td class="home-list-content" width="30" align="center">&nbsp;
		    	<img src="./images/view.gif" width="14" height="14" style="cursor:hand"  alt="<fmt:message key="button.view"/>"  onClick="window.location='./vipServiceSheet.html?method=view&id=<c:out value="${results.id}"/>'">&nbsp;
		    </td>
		     <td class="home-list-content" width="50" align="center">&nbsp;
		    	<img src="./images/view.gif" width="14" height="14" style="cursor:hand"  alt="<fmt:message key="button.view"/>"  onClick="window.location='./vipServiceSheet.html?method=promises&id=<c:out value="${results.id}"/>'">&nbsp;
		    </td>
                    </tr>
		</c:forEach> 
                  </table>
                </td>
              </tr>
            </table></td>
        </tr>
        <tr> 
          <td height="12"> <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td class="home-table-bottom-left">&nbsp;</td>
                <td class="home-table-bottom-bg">&nbsp;</td>
                <td class="home-table-bottom-right">&nbsp;</td>
              </tr>
            </table></td>
        </tr>
      </table></td>
  </tr>
  <tr> 
    <td height="10">&nbsp;</td>
  </tr>
</table>
</html:form>
</body>
<script>


function vipSearch(){
    //alert("come search");
    //将需要验证的ID传入数组
	var propertyArray = new Array();
	propertyArray.push("flightNum");
	propertyArray.push("flightDate");
	propertyArray.push("fromPort");
	propertyArray.push("toPort");
	propertyArray.push("bookNumb");
	propertyArray.push("name");
	//alert(propertyArray.length)
	//把验证数组传入验证特殊字符函数
	var result=checkSpecialInput(propertyArray);
	//alert("result="+result);
	if(result==true||result==null){
	     //alert(result);
	    vipServiceSheetForm.submit();
	     
	}else{
	    alert(result);
	}
}
//written by kellen 07-04-19
function doDelete(chkName){  
		var selected = new Array(); 
		var val = "";	  
		   for (var i=0;i < document.forms[0].elements.length; i++){
				var e = document.forms[0].elements[i];  
				if (e.name==chkName){
					var chk = document.forms[0].elements[i];
					if(chk.checked){
						var bb = e.value; 
					    	selected.push(bb);
					    	//alert(e.procInstId);
					    	//alert(e.approvedMan);
					    	if(e.approvedMan!=''){
					    	 alert("删除失败，不能删除已审核或已发起的流程！");
					    	 return;
					    	}
					    	
					    	break;
					} 
				}	 
			}	 
 		if(0!=selected.length){
 			if(confirm("<fmt:message key="common.confirm.message"/>")){  
				document.forms[0].method="post";
				document.forms[0].action="./vipServiceSheet.html?method=delete";
				document.forms[0].submit();
			}else return;	  			
		}else{
			alert("<fmt:message key="common.delete.message"/>");
		}	 
	}
function doReset(t1,t2,t3,t4,t5,t6,t7){
		document.getElementById(t1).value="";
		document.getElementById(t2).value="";
		document.getElementById(t3).value="";
		document.getElementById(t4).value="";
		document.getElementById(t5).value="";
		document.getElementById(t6).value="";
		document.getElementById(t7).value="";		
		
	}	
</script>
</html> 